package org.liaohailong.library.image

import android.content.Context
import android.graphics.drawable.Drawable
import android.widget.ImageView
import java.io.File

/**
 * Author: liaohailong
 * Date: 2019/3/7
 * Time: 9:34 PM
 * Description: 网络图片引擎规范
 **/
interface ImageEngine {

    fun setImage(imageView: ImageView,
                 url: String,
                 width: Int,
                 height: Int,
                 placeHolder: Drawable?,
                 errorDrawable: Drawable?,
                 callback: OnImageEngineCallback?)

    fun loadImage(context: Context,
                  url: String,
                  path: String,
                  width: Int,
                  height: Int,
                  callback: OnImageEngineCallback)

    interface OnImageEngineCallback {
        fun onImageAttachedComplete(imageView: ImageView, url: String, success: Boolean) {}
        fun onImageLoadedComplete(path: String, url: String, success: Boolean) {}
    }
}